import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Analyze from "../views/Analyze.vue";
import Console from "../views/Console.vue";
import workbench from "../views/workbench"
import basicform from "../views/basicform"
import viewlist from "../views/viewlist"
/*数据新增表单*/
import addFrom from "../views/fromarea"

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        component: Home,
        redirect: '/Analyze',
        children: [
            {path: '/Analyze', component: Analyze},
            {path: '/Console', component: Console},
            {path: '/workbench', component: workbench},
            {path: '/basicform', name: "basicform", component: basicform},
            {path: '/viewlist', component: viewlist},
            /*某某列表的数据新增页面*/
            {path: '/addFrom', name: "addFrom", component: addFrom},
            /*某某列表的数据编辑页面           异步懒加载方式，节约系统内存资源,只有切换到这个路由的时候，才加载页面*/
            {path: '/editFormData', name: "editFormData", component:resolve => require(['@/views/fromarea/editFormData'],resolve) },
        ]
    },

]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
